<script runat="server">
protected void Button1_Click(object sender, EventArgs e)
{
if (PeterBlum.DES.Globals.WebFormDirector.IsValid)
{
}
}
</script>
<asp:Label ID="YourAgeLabel" runat="server">Your Age:</asp:Label>
<des:TextBox ID="Age" runat="server" Width="40px" />
<des:RequiredTextValidator ID="rtvAge" runat="server" ControlIDToEvaluate="Age"
ErrorMessage="Required"
SummaryErrorMessage="{LABEL} is required"
Label-LabelControlID="YourAgeLabel" Label-TrimTrailingSymbol="true" Label-Case="TitleCase"
ShowRequiredFieldMarker="true" >
<ErrorFormatterContainer>
<des:TextErrorFormatter Display="Dynamic" />
</ErrorFormatterContainer>
</des:RequiredTextValidator>
<des:DataTypeCheckValidator ID="DataTypeCheckValidator1" runat="server" ControlIDToEvaluate="Age"
ErrorMessage="Enter a number"
SummaryErrorMessage="Enter a number in {LABEL}. You entered [{TEXTVALUE}]."
Label-LabelControlID="YourAgeLabel" Label-TrimTrailingSymbol="true" Label-Case="TitleCase"
DataType="Integer" >
<ErrorFormatterContainer>
<des:TextErrorFormatter Display="Dynamic" />
</ErrorFormatterContainer>
</des:DataTypeCheckValidator>
<des:RangeValidator ID="RangeValidator1" runat="server" ControlIDToEvaluate="Age"
ErrorMessage="Between {MINIMUM} and {MAXIMUM}"
SummaryErrorMessage="{LABEL} must be between {MINIMUM} and {MAXIMUM}"
Label-LabelControlID="YourAgeLabel" Label-TrimTrailingSymbol="true" Label-Case="TitleCase"
DataType="Integer"
Minimum="1" Maximum="120">
<ErrorFormatterContainer>
<des:TextErrorFormatter Display="Dynamic" />
</ErrorFormatterContainer>
</des:RangeValidator>
<br/>
Details: <des:TextBox ID="Details" runat="server" Width="300px" />
<des:TextLengthValidator ID="tlvDetails" runat="server" ControlIDToEvaluate="Details"
ErrorMessage="Exceeds {MAXIMUM} by {EXCEEDS} {EXCEEDS:character:characters}"
SummaryErrorMessage="{LABEL} exceeds {MAXIMUM} by {EXCEEDS} {EXCEEDS:character:characters}"
Label-Text="Details"
Maximum="20"/>
<hr/>
<des:Button ID="Submit" runat="server" Text="Submit" OnClick="Button1_Click" />
<br/><br/>
<des:ValidationSummary ID="ValidationSummary1" runat="server"
HeaderText="Fix these errors" />